package com.danbay.cloud.base.constants;


/**
 * 资源类型
 *
 * @author SJG
 *         2018/1/12
 */
public enum ResourceType {
    MENU(0, "菜单"),
    BUTTON(1, "按钮");

    private final int value;
    private final String phrase;

    ResourceType(int value, String phrase) {
        this.value = value;
        this.phrase = phrase;
    }

    public int value() {
        return value;
    }

    public static String getPhrase(int value) {
        for (ResourceType t : values()) {
            if (t.value == value) {
                return t.phrase;
            }
        }
        return "错误类型";
    }
}